<?php

/**
 * ResultAnswers form base class.
 *
 * @method ResultAnswers getObject() Returns the current form's model object
 *
 * @package    tests
 * @subpackage form
 * @author     Djul
 */
abstract class BaseResultAnswersForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'          => new sfWidgetFormInputHidden(),
      'result_id'   => new sfWidgetFormPropelChoice(array('model' => 'Result', 'add_empty' => false)),
      'question_id' => new sfWidgetFormPropelChoice(array('model' => 'Question', 'add_empty' => false)),
      'result'      => new sfWidgetFormInputCheckbox(),
    ));

    $this->setValidators(array(
      'id'          => new sfValidatorPropelChoice(array('model' => 'ResultAnswers', 'column' => 'id', 'required' => false)),
      'result_id'   => new sfValidatorPropelChoice(array('model' => 'Result', 'column' => 'id')),
      'question_id' => new sfValidatorPropelChoice(array('model' => 'Question', 'column' => 'id')),
      'result'      => new sfValidatorBoolean(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('result_answers[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'ResultAnswers';
  }


}
